#include <iostream>
using namespace std;
int main()
{
	int n,sum=0;
    cin>>n;
    	while(1){
    		sum+=n%10;
    		n=n/10;
    		if(n==0)
            break;
		}
    cout<<sum;
    return 0;
}
